<template>
  <div>
    <!-- 头部部分 -->
    <header class="header">
      <h1>todos</h1>
      <input
        class="new-todo"
        placeholder="请输入任务名称"
        autofocus
        @keydown.enter="addlist"
      />
    </header>
  </div>
</template>

<script>
export default {
  name: 'TodoHead',
  components: {},
  props: {},
  data() {
    return {}
  },
  computed: {},
  watch: {},
  created() {},
  methods: {
    //添加
    addlist(e) {
      this.$emit('addlist', e.target.value.trim())
      e.target.value = ''
    },
  },
}
</script>

<style scoped></style>
